<?php
class NoBusinessBase_Helper_Version extends Zend_Controller_Action_Helper_Abstract
{
   public function direct()
   {
      return $this;
   }

   public function getVersion()
   {
      $filePath = APPLICATION_PATH . '/version';
      if(!file_exists($filePath))
         return "UNDEFINED";
      $contents = file_get_contents($filePath);
      if(!$contents)
         return 'NONE';

      return str_replace("\n", '', $contents);
   }

   public function getVersionNoSpecialCharacters()
   {
      $version = $this->getVersion();
      return str_replace(array('.', ' '), array('_', '_'), $version);
   }
}

